import Vue from "vue";
import VueRouter from "vue-router";
import MainRouter from "./router";
import specialRouter from "./specialRouter"

Vue.use(VueRouter);

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

export const routes = [
	{
		path: "/",
		redirect: '/login',
		component: () => import("@/views/mainPage.vue"),
		children: MainRouter
	},
	{
		path: "/special",
		redirect: '/specialLogin',
		component: () => import("@/views/mainPage.vue"),
		children: specialRouter
	},
	{
		path: "/login",
		name: "login",
		component: () => import("@/views/backLogin.vue"),
	},{
		path: "/specialLogin",
		name: "specialLogin",
		component: () => import("@/views/specialLogin.vue"),
	},{
		path: "/szzt.html",
		name: "szzt.html",
		component: () => import("@/views/large-board/szzt/index.vue"),
	},{
		path: "/scrw.html",
		name: "scrw.html",
		component: () => import("@/views/large-board/scrw/index.vue"),
	},{
		path: "/scdd.html",
		name: "scdd.html",
		component: () => import("@/views/large-board/scdd/index.vue"),
	},{
		path: "/ccrw.html",
		name: "ccrw.html",
		component: () => import("@/views/large-board/ccrw/index.vue"),
	},{
		path: "/yyzx.html",
		name: "yyzx.html",
		component: () => import("@/views/large-board/yyzx/index.vue"),
	},
	{
		path: "/ybfb.html",
		name: "ybfb.html",
		component: () => import("@/views/basic-data/big-screen/index-new.vue"),
	},
	{
		path: "/shenbao.html",
		name: "shenbao.html",
		component: () => import("@/views/large-board/shenbao/index.vue"),
	},
	{
		path: "/ubao.html",
		name: "ubao.html",
		component: () => import("@/views/large-board/ubao/index.vue"),
	},
	{
		path: "/bigScreen.html",
		name: "bigScreen.html",
		component: () => import("@/views/large-board/bigScreen/index.vue"),
	},
];

const router = new VueRouter({
	routes
});

export default router;
